Global Index
HTML5 JS API Index > Web Sockets and Messaging Tutorials & Specs

CloseEvent

Extends Event.

The wasClean attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to false. It represents whether the connection closed cleanly or not.

Properties
unsigned short
code
The code attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to zero. It represents the WebSocket connection close code provided by the server.
DOMString
reason
The reason attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to empty string. It represents the WebSocket connection close reason provided by the server.
boolean
wasClean
The wasClean attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to false. It represents whether the connection closed cleanly or not.
Constructor
CloseEvent(DOMString type, optional CloseEventInit eventInitDict)